package com.yang.leather.common.util;

public class RandomUtil {
	private static final String[] RANDOM_CHARS = {"A","B","C","D","E","F","G","H","I",
		"J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c",
		"d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w",
		"x","y","z"};
	
	public static String randomString(int num){
		if(num <=0){
			num = 2;
		}
		StringBuilder sb = new StringBuilder();
		for(int i=0;i<num;i++){
			sb.append(RANDOM_CHARS[Long.valueOf(Math.round(Math.random()*RANDOM_CHARS.length-1)).intValue()]);
		}
		return sb.toString();
	}
	
	public static void main(String[] args){
		System.out.println(randomString(3));
	}
}
